package com.powernode.mapper;

import org.apache.ibatis.annotations.*;
import com.powernode.pojo.Book;

import java.util.List;

/**
 * @author 繁寂
 * @version 1.0
 * @since 1.0
 */
@Mapper
public interface BookMapper {
    @Select("select * from t_book where name like CONCAT('%', #{name}, '%')")
    List<Book> selectByName(String name);

    @Select("select * from t_book")
    List<Book> selectAll();

    @Insert("insert into t_book value(id=#{id},#{name},#{num})")
    int insertByName(Book book);

    @Update("update t_book set name=#{name},num=#{num} where id=#{id}")
    int updateByName(Book book);

    @Delete("delete from  t_book  where name=#{name}")
    int deleteByName(Book book);

}
